package com.hos.utils;

import java.util.Random;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/13 9:38
 * @description: 主键id生成策略
 * @modified By:
 * @version:
 */
public class IdGeneratorUtil {

    /**
     * @param entity 生成的前缀
     * @return java.lang.String
     * @create by: 陈海彬
     * @description: 例如，生成"HZ" + 当前时间段 + 随机数
     * @create time: 2023/12/13 9:39
     */
    public static String nextId(String entity) {
        return entity + System.currentTimeMillis() + new Random().nextInt(1000000);
    }

}